<template>
  <div class="content">
    <header>
      <ul><li @click="back()" class="grey"><img class="back-icon" src="~assets/img/icon_l@2x.png" alt=""> 返回</li><li><h2 style="font-size:16px">{{$parent.title}}</h2></li><li></li></ul>
    </header>
      <router-link to="/reset_pwd" tag="div" class="common-li" v-if='!isShow'>重置支付密码<img class="more-icon" src="~assets/img/icon-r@2x.png" alt="重置支付密码"></router-link>
      <div class="common-li" @click="set_pwd()" v-if='isShow'>设置支付密码<img class="more-icon" src="~assets/img/icon-r@2x.png" alt="设置支付密码"></div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      isShow: true,
      pwd_token: ''
    }
  },
  mounted () {
    this.$apiPost(`paystatus`, {}
      ).then((data) => {
        if (data.status === 0) {
          this.pwd_token = data.data.pwd_token
          if (data.data.recode === 0) {
            this.isShow = true
          } else if (data.data.recode === 1) {
            this.isShow = false
          }
        } else {

        }
    })
  },
  methods: {
    back () {
      this.$router.push('/user_info')
    },
    set_pwd () {
      this.$router.push({name:'set_pwd',params:{'pwd_token':this.pwd_token}})
    }
  }
}
</script>
<style scoped>
</style>
